// 接收两个参数（state, action）
// reducer 要接收action 然后进行逻辑处理

const initState = {
  count: 0
}
exports.reducer = (state = initState, action) => {
  // console.log('reducer:', action.type);
  switch (action.type) {
    case 'add_count':
      return {
        count: state.count + 1,
        current: '我是++'

      }
    case 'sub_count':
      return {
        count: state.count - 1,
        current: '我是--'
      }
    default:
      return state
  }
}